package com.intelli4.pos.ui;

import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.Window;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;

public class TenderDialog extends JDialog {
	private static final long serialVersionUID = -1578953166355335714L;

	private JTextField numberFld;
	private NumberPadPanel numberPadPanel;

	public TenderDialog(Window owner) {
		super(owner);

		init();
	}

	protected void init() {
		setLayout(new BorderLayout(5, 5));
		setModal(true);

		JPanel numberPanel = new JPanel();
		numberPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		numberPanel.setLayout(new BorderLayout(5, 5));

		numberPanel.add(new JLabel("Amount"), BorderLayout.WEST);
		numberFld = new JTextField();
		numberPanel.add(numberFld, BorderLayout.CENTER);
		
		add(numberPanel, BorderLayout.NORTH);

		numberPadPanel = new NumberPadPanel();
		add(numberPadPanel, BorderLayout.CENTER);
		
		JPanel btnPanel = new JPanel();
		btnPanel.setLayout(new GridLayout(5, 1, 5, 5));
		btnPanel.add(new JButton("10"));
		btnPanel.add(new JButton("20"));
		btnPanel.add(new JButton("50"));
		
		add(btnPanel, BorderLayout.EAST);
		
	}

	public static void main(String[] args) {
		TenderDialog dialog = new TenderDialog(null);
		dialog.setSize(400, 300);
		dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
		dialog.setVisible(true);
	}
}
